;
;  ======== vectors.asm ========
;  Plug in the entry point at RESET in the interrupt vector table
;

;
;  ======== unused ========
;  plug inifinite loop -- with nested branches to
;  disable interrupts -- for all undefined vectors
;
unused  .macro id
        .global unused:id:
unused:id:
        b irp
        nop
        nop
        nop
        nop
        nop
        nop
		nop
        .endm


        .sect ".vectors"

        .ref _c_int00           ; C entry point
	.ref _Int_GPIOBNK4ISR
	.ref _Int_GPIOBNK5ISR
	.ref _Int_TimerISR
        .ref _Int_RszISR		; external interrupt INT 14 handler
	.ref _Int_VencISR		; external interrupt INT 14 handler
        .align  32*8*4          ; must be aligned on 256 word boundary

RESET:                          ; reset vector
        mvkl _c_int00,b0        ; load destination function address to b0
        mvkh _c_int00,b0
        b b0                    ; start branch to destination function
        mvc PCE1,b0             ; address of interrupt vectors
        mvc b0,ISTP             ; set table to point here
        nop 3                   ; fill delay slot
        nop
        nop

        ;_extint14_isr
        ;  plug unused interrupts with infinite loops to
        ;  catch stray interrupts
        ;
NMI:    b nrp
		nop
		nop
		nop
		nop
		nop
		nop
		nop
        unused 2
        unused 3
        unused 4
        unused 5
        unused 6
        unused 7
        unused 8
INT9:
		stw b0,*--b15
		mvkl _Int_RszISR,b0
		mvkh _Int_RszISR,b0
		b b0
		ldw *b15++,b0
		nop 3
		nop
		nop
INT10:
		stw b0,*--b15
		mvkl _Int_VencISR,b0
		mvkh _Int_VencISR,b0
		b b0
		ldw *b15++,b0
		nop 3
		nop
		nop
INT11:
		stw b0,*--b15
		mvkl _Int_TimerISR,b0
		mvkh _Int_TimerISR,b0
		b b0
		ldw *b15++,b0
		nop 3
		nop
		nop
        unused 12
INT13:
		stw b0,*--b15
		mvkl _Int_GPIOBNK4ISR,b0
		mvkh _Int_GPIOBNK4ISR,b0
		b b0
		ldw *b15++,b0
		nop 3
		nop
		nop
INT14:
		stw b0,*--b15
		mvkl _Int_GPIOBNK5ISR,b0
		mvkh _Int_GPIOBNK5ISR,b0
		b b0
		ldw *b15++,b0
		nop 3
		nop
		nop
        unused 15

